<template>
  <div>
    <div class="currency">
      <div class="top_box">
        <router-link tag="div" to="/userinfo" class="account">
          <span class="iconfont icon-houtui"></span>我的账号
        </router-link>
        <p class="one">账户余额（起点币）</p>
        <p class="two">
          <span>{{ coin }}</span>
          <span>含0赠币</span>
        </p>
      </div>
    </div>
    <div class="bg"></div>

    <div class="recharge">
      <router-link tag="div" to="/recharge" class="left">
        <i></i>
        <span>充值</span>
      </router-link>
      <div class="right">
        <span class="iconfont icon-qianjin"></span>
      </div>
    </div>

    <div class="bg"></div>

    <div class="record">
      <p>充值记录</p>
      <p>消费记录</p>
    </div>

    <!-- 书签 -->
    <div class="bookmarkX">
      <div class="null-x">
        <i></i>
        <p>你还没有充值 ， 近期无充值记录</p>
      </div>
    </div>

    <!-- 底部 -->
    <div class="footer-link">
      <div class="top">
        <p>QQ阅读</p>
        <p>红袖添香</p>
      </div>
      <div class="among">
        <p>客户端</p>
        <p>触屏版</p>
        <p>帮助与客服</p>
        <p>搜索</p>
      </div>
      <div class="footer-copy">
        <p>网站备案/许可证号：沪B2-20080046-1</p>
        <p>互联网宗教信息服务许可证 编号：沪（2022）0000022</p>
        <p>沪B2-20080046-1</p>
      </div>
    </div>
    <div class="content">
      <div class="img">
        <img src="../assets/img/fixed.png" alt="" />
        <div class="text">
          <p>安装起点读书客户端</p>
          <p>看更多正版好书</p>
        </div>
      </div>
      <div class="download">下载</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      coin: null,
    };
  },
  created() {
    if (!window.localStorage.coin) {
      window.localStorage.setItem("coin", 0); 
    }
    this.coin = parseInt(window.localStorage.coin);
  },
};
</script>

<style lang="scss" scoped>
.record {
  display: flex;
  p {
    width: 50%;
    text-align: center;
    font-size: 14px;
    padding: 15px 7px;
    &:nth-child(1) {
      border-bottom: 1px solid #ed424b;
      color: #ed424b;
    }
    &:nth-child(2) {
      border-bottom: 1px solid #e3e4e6;
    }
  }
}

.recharge {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .left {
    display: flex;
    i {
      display: block;
      background: url("https://qidian.gtimg.com/qdm/icon/center/sprite@2x.8723f.png");
      background-position: -68px -22px;
      width: 18px;
      height: 18px;
      background-size: 106px 73px;
      margin-top: 1px;
    }
    span {
      margin-left: 5px;
      font-weight: 600;
    }
  }
}

.currency {
  .top_box {
    background: #f0643a;
    .account {
      padding: 15px;
      color: #fff;
      span {
        margin-right: 5px;
      }
    }
    .one {
      padding: 0 15px;
      color: #fff;
      opacity: 0.6;
      font-size: 12px;
    }
    .two {
      padding: 15px;
      span {
        &:nth-child(1) {
          color: #fff;
          font-weight: 600;
          font-size: 32px;
        }
        &:nth-child(2) {
          color: #fff;
          font-size: 12px;
          margin-left: 10px;
        }
      }
    }
  }
}

.bg {
  width: 100%;
  height: 10px;
  background-color: #f6f7f9;
}

// 书签
.bookmarkX {
  position: absolute;
  left: 93px;
  top: 330px;
  .null-x {
    position: relative;
    i {
      display: block;
      background: url("");
      width: 36px;
      height: 48px;
      margin: 0 auto;
    }
    p {
      margin-top: 5px;
      color: #969ba3;
      font-size: 12px;
    }
  }
}

/* 导航 */
.nav {
  display: flex;
  padding: 9px 12px;
  justify-content: space-between;
  background-color: #fff;
  h1 {
    height: 26px;
    line-height: 26px;
    font-size: 18px;
    color: #ee2737;
    font-weight: bold;
    display: block;
    display: flex;
    span {
      font-size: 14px;
      color: #33373d;
      font-weight: normal;
      margin-left: 16px;
      margin-top: 2px;
    }
    i {
      display: block;
      width: 9px;
      height: 18px;
      background: url("../assets/img/arrow_da.gif") center center no-repeat;
      margin-top: 5px;
    }
  }
  .sex {
    display: flex;
    height: 24px;
    line-height: 24px;
    border: 1px solid #ed424b;
    p {
      &:nth-child(1) {
        padding: 0 12px;
        background-color: #ed424b;
        font-size: 12px;
        color: #fff;
      }
      &:nth-child(2) {
        padding: 0 12px;
        background-color: #fff;
        font-size: 12px;
        color: #ed424b;
      }
    }
  }
  .img {
    display: flex;
    img {
      width: 16px;
      height: 16px;
      padding-top: 6px;
    }
    a {
      &:nth-child(1) {
        img {
          margin-right: 20px;
        }
      }
    }
  }
}

// 最新章节目录
.cata_title {
  padding: 10px 10px 0 10px;
  display: flex;
  text-align: center;
  p {
    font-size: 14px;
    width: 50%;
    padding-bottom: 10px;
    &:nth-child(1) {
      border-bottom: 1px solid #e3e4e6;
      color: #969ba3;
    }
    &:nth-child(2) {
      color: #ee2737;
      border-bottom: 1px solid #ee2737;
    }
  }
}

.footer-link {
  background-color: #fff;
  padding-top: 22px;
  padding-bottom: 24px;
  margin-top: 164px;
  .top {
    p {
      width: 50%;
      text-align: center;
      font-size: 14px;
      color: #969ba3;
    }
  }
  .among {
    margin-top: 34px;
    p {
      width: 25%;
      text-align: center;
      font-size: 14px;
      color: #969ba3;
    }
  }
  .footer-copy {
    text-align: center;
    font-size: 12px;
    color: #969ba3;
    margin-top: 20px;
  }
}
.footer-link .top,
.footer-link .among {
  display: flex;
}
.content {
  background-color: #f6f7f9;
  padding: 0 16px 17px 16px;
  display: flex;
  justify-content: space-between;
  .img {
    display: flex;
    margin-top: 12px;
    img {
      width: 36px;
      height: 36px;
    }
    .text {
      margin-left: 12px;
      p {
        &:nth-child(1) {
          font-size: 14px;
          color: #33373d;
        }
        &:nth-child(2) {
          font-size: 12px;
          color: #969ba3;
        }
      }
    }
  }
  .download {
    margin-top: 16px;
    font-size: 14px;
    padding: 7px 16px;
    background-color: #ed424b;
    color: #fff;
    border-radius: 18px;
  }
}
a {
  text-decoration: none;
  color: #000;
}
.bottom {
  position: fixed;
  bottom: 46px;
  left: 0px;
  right: 0;
  margin: auto;
  display: flex;
  background-color: #ed424b;
  padding: 5px 8px;
  border-radius: 12px;
  width: 251px;
  .img {
    img {
      width: 18px;
      height: 18px;
      margin-top: 3px;
    }
  }
  .text {
    color: #fff;
    text-indent: 0.5rem;
  }
}
</style>
